]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Reduce spacing around the workspaces minimap
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 16 Jan 2024 20:39:15 +0000 (21:39 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 14 May 2024 18:24:07 +0000 (18:24 +0000)
With a previous commit we've made the overall dynamic spacing dynamic, but
the spacing is now a bit much when it comes to the space between search and
workspaces minimap, just as workspaces minimap and large workspaces.

The  minimap should somewhat "squeeze into the empty space" here, so
reduce the spacings above and below it a bit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3278>

js/ui/overviewControls.js

index 43817a86280185749ffb5d1f519faefb2bcb7e0b..0fc81d85c8516666449108ab03022120dbc52ccf 100644 (file)
@@ -22,6 +22,8 @@ import * as WorkspacesView from './workspacesView.js';
 export const SMALL_WORKSPACE_RATIO = 0.15;
 const DASH_MAX_HEIGHT_RATIO = 0.15;
 const VERTICAL_SPACING_RATIO = 0.02;
+const THUMBNAILS_SPACING_ADJUSTMENT_TOP = 0.6;
+const THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM = 0.4;
 
 const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
 
@@ -88,13 +90,13 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
             break;
         case ControlsState.WINDOW_PICKER:
             workspaceBox.set_origin(0,
-                startY + searchHeight + spacing +
-                thumbnailsHeight + spacing * expandFraction);
+                startY + searchHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) +
+                thumbnailsHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction);
             workspaceBox.set_size(width,
                 height -
                 dashHeight - spacing -
-                searchHeight - spacing -
-                thumbnailsHeight - spacing * expandFraction);
+                searchHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP) -
+                thumbnailsHeight - Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_BOTTOM) * expandFraction);
             break;
         case ControlsState.APP_GRID:
             workspaceBox.set_origin(0, startY + searchHeight + spacing);
@@ -188,7 +190,7 @@ class ControlsManagerLayout extends Clutter.LayoutManager {
             thumbnailsHeight = Math.min(
                 thumbnailsHeight * expandFraction,
                 height * this._workspacesThumbnails.maxThumbnailScale);
-            childBox.set_origin(0, startY + searchHeight + spacing);
+            childBox.set_origin(0, startY + searchHeight + Math.round(spacing * THUMBNAILS_SPACING_ADJUSTMENT_TOP));
             childBox.set_size(width, thumbnailsHeight);
             this._workspacesThumbnails.allocate(childBox);
         }